package com.lwp.springboot.sbmybatis.controller;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.sql.DataSource;
import java.time.LocalDateTime;

@RequestMapping("test")
@RestController
@Slf4j
public class TestController {

    @Autowired
    DataSource dataSource;

    @GetMapping("hi")
    public String hi(String name) {
        log.debug("debug");
        log.info("info");
        log.warn("warn");
        log.error("error");
        log.warn(dataSource.getClass().getName());

        return "hi " + name;
    }

}
